﻿@{
    ViewBag.Title = "Index";
}


<!DOCTYPE html>

<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    function deng()
    {
        $.ajax({
            type: "post",
            url: "/home/login",
            data: {
                lname: $("#name").val(),
                lpwd:$("#pwd").val(),
            },
            success: function (i)
            {
                if (i > 0) {
                    alert("登录成功");
                    location.href = '/index/show'

                }
                else {
                    alert("登录失败");

                }

            }



        })



    }




</script>



@*<h1><strong>考试登录平台</strong></h1>
<tr>
    <td>账号：<input id="name" type="text" placeholder="请输入账号！" /></td>
    <td>密码：<input id="pwd" type="password" placeholder="请输入密码！" /></td>

    <td><input id="Button1" type="button" value="登录" onclick="deng()" /></td>


</tr>*@ 
<html lang="">
<head>
    <meta charset="utf-8">
    <title>登录考试平台 </title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="robots" content="" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
    <link href="~/family/css/style.css" rel="stylesheet" />
  
    <!--[if IE]><link rel="stylesheet" href="css/ie.css" media="all" /><![endif]-->
</head>

<body class="login">
    <section>
        <h1><strong>考试登录平台</strong></h1>
        <tr>
            <td>账号：<input id="name" type="text" placeholder="请输入账号！" /></td>
            <td>密码：<input id="pwd" type="password" placeholder="请输入密码！" /></td>
    
            <td><input id="Button1" type="button" value="登录" onclick="deng()" /></td>


        </tr> 
        <p><a href="#">忘记密码了吗?</a></p>
    </section>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
    <script type="text/javascript">

// Page load delay by Curtis Henson - http://curtishenson.com/articles/quick-tip-delay-page-loading-with-jquery/
$(function(){
	$('.login button').click(function(e){
		// Get the url of the link
		var toLoad = $(this).attr('href');

		// Do some stuff
		$(this).addClass("loading");

			// Stop doing stuff
			// Wait 700ms before loading the url
			setTimeout(function(){window.location = toLoad}, 10000);

		// Don't let the link do its natural thing
		e.preventDefault
	});

	$('input').each(function() {

       var default_value = this.value;

       $(this).focus(function(){
               if(this.value == default_value) {
                       this.value = '';
               }
       });

       $(this).blur(function(){
               if(this.value == '') {
                       this.value = default_value;
               }
       });

});
});
    </script>
</body>
</html>
